package com.util;

import com.yunpian.sdk.YunpianClient;
import com.yunpian.sdk.model.Result;
import com.yunpian.sdk.model.SmsSingleSend;

import java.util.Map;

public class PhoneSMSUtil {
    //15a3e0788f5bc7fbffd829eea4565aa8
    private static final YunpianClient client = new YunpianClient("15a3e0788f5bc7fbffd829eea4565aa8");
    static {
        client.init();
    }


    public void sendSMSVerifyCode(String phoneNumber,String code){
        Map<String, String> param = client.newParam(2);
        param.put(YunpianClient.MOBILE,phoneNumber);
        param.put(YunpianClient.TEXT, "【锦绣网】您的验证码是"+code);
        Result<SmsSingleSend> r = client.sms().single_send(param);
    }

    public static void main(String[] args) {
        new PhoneSMSUtil().sendSMSVerifyCode("13714488403","123");
    }
}
